<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ page import="java.util.ArrayList,
                 com.scalar.chiptrack.utils.ConfigManager" %>


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<chiptrack:checkLogon sourcePage="/baseProductList.do"/>

<%String chipTracContext = "/" + ConfigManager.getChipTracContext();%>

<HTML><HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type=text/css rel=stylesheet>

<script>

function substep(id,action)
{
	document.fabcontd.action='<%=chipTracContext%>/fabSubStage.do?action='+action+'&id='+id;
	document.fabcontd.submit();
		
}

function saveFabStage()
{
	document.fabcontd.submit();
		
}


</script>

<META content="MSHTML 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" marginwidth="0">

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<html:form name="fabcontd"  type="com.scalar.chiptrack.operations.process.forms.FabStageForm" action="/fabStage">

<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
  <TR>
	<TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

<!-- Side Navigation start -->

<%@ include file="/jsp/operations/operations_menu.jsp" %>

	</TD>
<!-- end of the side navigations -->

<TD bgcolor="#ffffff">
<IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
<TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
<TD valign="top" width="100%">

<IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
<BR>
<!-- from here your body starts -->

<center><span class="NArialW">FAB Contd...</span></center>
<img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height=20>

  <font class="NArialL">

    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    FAB Step Information</p>

    <div align="right">

    <table border="0" width="90%" bordercolor="#FFFFFF">
		
	
      <tr>
        <td width="17%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">FAB
          Step Name</font></td>
        <td width="15%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Add
          Sub Step</font></td>
        <td width="32%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Comments</font></font></td>
      </tr>

	 <logic:iterate id="fabStageList" name="fabStageList">
	 <logic:notEqual name="fabStageList" value="null">
      <tr>
           <td width="17%" align="left" bgcolor="#DEE1E2"><font class="NArialL">
	  <p align="center"> <html:text name="fabStageList"  property="fabStageName" size="15" 
	   styleClass="txfield" /></font></p></td>
        
        <td width="15%" bgcolor="#DEE1E2">
          <p align="center"><font class="NArialL">
<a href="javascript:substep('<bean:write name="fabStageList" property="stageId" />','<bean:write name="fabStageList" property="type" />')">Add
          Sub Step</a></font></p>
        </td>
        <td width="32%" bgcolor="#DEE1E2">
 <p align="center">
 <html:textarea rows="3" name="fabStageList" property="comments" styleClass="txfield" />
 </p>
 </td>
      </tr>
<html:hidden name="fabStageList" property="stageId" />
<html:hidden name="fabStageList" property="type" />
<html:hidden name="fabStageList" property="order" />
</logic:notEqual>
</logic:iterate>


	<% ArrayList fabStageList =(ArrayList) request.getAttribute("fabStageList");
		if(fabStageList.size()==0){
	//System.out.println("In if");
			
	%>
	
	<tr>
  <td width="17%" align="left" bgcolor="#FFFFEE"><font class="NArialL">
<p align="center"><html:text  property="fabStageName" size="15" styleClass="txfield" /></font></p></td>
<td width="15%" bgcolor="#FFFFEE">
<p align="center"><font class="NArialL"><a href="javascript:substep('1','new')">Add
   Sub Step</a></font></p>
        </td>
<td width="32%" bgcolor="#FFFFEE">
<p align="center"><html:textarea rows="3" property="comments" styleClass="txfield" />
		</p></td>
  </tr>
		<input type="hidden" name="order" value="1" >
		<input type="hidden" name="stageId" value="1" >
		<input type="hidden" name="type" value="new" >
    <tr>
<td width="17%" align="left" bgcolor="#FFFFEE"><font class="NArialL">
<p align="center">
<html:text  property="fabStageName" size="15" styleClass="txfield" />
</p>		</font></td>

<td width="15%" bgcolor="#FFFFEE">
<p align="center"><font class="NArialL"><a href="javascript:substep('2','new')">Add
   Sub Step</a></font></p>
        </td>
<td width="32%" bgcolor="#FFFFEE">
<p align="center">
<html:textarea rows="3" property="comments" styleClass="txfield" /></p></td>

</tr>
	<input type="hidden" name="order" value="2" >
	<input type="hidden" name="stageId" value="2" >
	<input type="hidden" name="type" value="new" >


<%}%>

    </table>

    </div>

 <p align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
   <a href="javascript:saveFabStage()">
   <img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif"></a>
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     
   </p>


      </font>



<!-- till here -->
<BR><BR><BR></TD>
<TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
</TR>
</TABLE>

<!-- Footer starts here -->

<%@ include file="/jsp/includes/footer.jsp" %>

<!-- footer end here -->
</html:form>
</BODY>
</HTML>
